gtk_widget_destroy() removes widgets from their container. However
_internal_ widgets must be unref'ed using gtk_widget_unparent() instead.
This is symmetric with the fact that these widgets were ref'ed by direct
call to gtk_widget_set_parent(). It's also the method that was used in
gtk_headerbar_destroy().
https://bugzilla.gnome.org/show_bug.cgi?id=772859
if (priv->titlebar_start_box)
{
- gtk_widget_destroy (priv->titlebar_start_box);
+ gtk_widget_unparent (priv->titlebar_start_box);
priv->titlebar_start_box = NULL;
priv->titlebar_start_separator = NULL;
}
if (priv->titlebar_end_box)
{
- gtk_widget_destroy (priv->titlebar_end_box);
+ gtk_widget_unparent (priv->titlebar_end_box);
priv->titlebar_end_box = NULL;
priv->titlebar_end_separator = NULL;
}